package com.tjw.ec.upms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjw.ec.common.core.util.PageUtils;
import com.tjw.ec.common.core.util.Query;
import com.tjw.ec.upms.api.entity.PermitGroupEntity;
import com.tjw.ec.upms.dao.PermitGroupDao;
import com.tjw.ec.upms.service.PermitGroupService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 权限组表,将一模块的中的所有权限划分一个权限组中,可以通过权限组授予用户权限;
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-07-27 16:43:32
 */
@Service("permitGroupService")
public class PermitGroupServiceImpl extends ServiceImpl<PermitGroupDao, PermitGroupEntity> implements PermitGroupService {

    @Override
    public PageUtils<PermitGroupEntity> queryPage(Map<String, Object> params) {

        IPage<PermitGroupEntity> page = new Query<PermitGroupEntity>(params).getPage();

        QueryWrapper<PermitGroupEntity> queryWrapper = new QueryWrapper<>();

        IPage<PermitGroupEntity> data = baseMapper.selectPage(
                page,
                queryWrapper
        );

        return new PageUtils(data);
    }

}
